package com.etl.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.etl.bean.User;
import com.etl.dao.IUserDao;
import com.etl.mapper.IUserMapper;

@Repository("userDao")
public class UserDaoImpl implements IUserDao {

	@Resource
	private IUserMapper userMapper;
	
	public IUserMapper getUserMapper() {
		return userMapper;
	}

	public void setUserMapper(IUserMapper userMapper) {
		this.userMapper = userMapper;
	}
	@Override
	public List<User> findAllUsers() {
		return userMapper.findAllUsers();
	}

	@Override
	public User findUserById(int userId) {
		return userMapper.findUserById(userId);
	}

	@Override
	public User findUserByUserName(String userName) {
		return userMapper.findUserByUserName(userName);
	}

	@Override
	public User findUserByUserAccount(String userAccount) {
		return userMapper.findUserByUserAccount(userAccount);
	}

	@Override
	public void insertUser(User user) {
		userMapper.insertUser(user);		
	}

	@Override
	public void deleteUser(User user) {
		userMapper.deleteUser(user);
	}

	@Override
	public void updateUser(User user) {
		userMapper.updateUser(user);
	}

}
